package com.tandashi.springbootstudy01.dto;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class RestGeneralResponse<T> extends RestBaseResponse {

    public T data;

    public RestGeneralResponse() {
    }

    public RestGeneralResponse(T data) {
        super(ERR_OK, "OK");
        this.data = data;
    }

    public RestGeneralResponse(Integer code, String message, T data) {
        super(code, message);
        this.data = data;
    }

    public static <T> RestGeneralResponse<T> of(T data) {
        return new RestGeneralResponse<>(data);
    }
}
